﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Recognizer.Dollar;

namespace Segmentation.ShortStraw
{
    public class Segmentation
    {
        /**
         The main ShortStraw Corner Finding Algorithm    
        */
        public static ArrayList ShortStrawCornerFinding(ArrayList points)
        {
            ArrayList resampledPoints = Recognizer.Dollar.Utils.Resample(points, 64);
            
            ArrayList corners = Utils.GetCornerShortStraw(resampledPoints);
            /*
            var returnPoints = new ArrayList();

            foreach (Corner corner in corners)
            {
                if(corner.IsCorner)
                {
                    returnPoints.Add(corner.Point);                   
                }
            }
            return returnPoints;
             * */
            return corners;
        }

        public static ArrayList IStrawCornerFinding(ArrayList points)
        {
            ArrayList resampledPoints = Recognizer.Dollar.Utils.Resample(points, 64);

            ArrayList corners = Utils.GetCornersIStraw(resampledPoints);

            return corners;
        }
    }
}
